<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head lang="en">
    <meta charset="UTF-8">
     <title>登录</title>
  
         <!--animate.css-->
        <link rel="stylesheet" href="${pageContext.request.contextPath }/statics/css/animate.css">
         <!--bootstrap.min.css-->
        <link rel="stylesheet" href="${pageContext.request.contextPath }/statics/css/bootstrap.min.css">
        <!--style.css-->
        <link rel="stylesheet" href="${pageContext.request.contextPath }/statics/css/style.css">
        
        <!--responsive.css-->
        <link rel="stylesheet" href="${pageContext.request.contextPath }/statics/css/responsive.css">
   <!--   <link type="text/css" rel="stylesheet" href="${pageContext.request.contextPath }/statics/css/style.css" />-->
    
</head>
<body>
		<section class="signin signup popup-in popup-up">
			<div class="container">
				<div class="row">
					<div class="col-sm-12 " style="    position: relative;top: -120px;">
						<div class="single-sign">
							<div class="sign-content popup-in-content">
								<div class="popup-in-txt">
									<h2>注册</h2>
									<h3 style="color:red">${error }</h3>
									<div class="signin-form">
										<form action="${pageContext.request.contextPath }/provider/signsave.html" onsubmit="return check();"
										enctype="multipart/form-data" method="post">
											<div class="form-group">
											    <label for="proCode">用户编码：<span id="msg1" style="color:red;"></span></label>
											    <input readonly="readonly" type="text" class="form-control" id="proCode" name="proCode" value="${proCode }">
											</div><!--/.form-group -->
											<div class="form-group">
											    <label for="proName">商家名称：</label>
											    <input type="text" class="form-control" id="proName" name="proName" placeholder="用户名">
											    <span style="color:red"></span>
											</div><!--/.form-group -->
											<div class="form-group">
											    <label for="proAddress">商家地址：</label>
											    <input type="text" class="form-control" id="proAddress" name="proAddress" placeholder="用户名">
											</div><!--/.form-group -->
											<div class="form-group">
											    <label for="proPhone">联系电话：</label>
											    <input type="text" class="form-control" id="proPhone" name="proPhone" placeholder="联系电话">
											</div><!--/.form-group -->
											
											
											<div class="form-group">
											    <label for="org_PicPath">营业执照</label>
											    <input type="file" class="form-control" id="org_PicPath"  name="attach">
											</div><!--/.form-group -->
											<div class="form-group">
												<label for="password">密码：</label>
											    <input type="password" class="form-control" id="password" name="newpassword" placeholder="输入您的密码">
											</div><!--/.form-group -->

										
									
									<div class="signin-footer">
										<button type="submit" class="btn signin_btn" id="save">
											注册
											<!--data-toggle="modal" data-target=".signin_modal"  -->
										</button>
										<p>
											已经记住了 ? <a href="${pageContext.request.contextPath }/provider/login">去登录试一试吧</a>
										</p>
									</div><!--/.signin-footer -->
									</form><!--/form -->
									</div><!--/.signin-form -->
								</div><!--/.popup-in-txt -->
							</div><!--/.sign-content -->
						</div><!--/.single-sign -->
					</div><!--/.col -->
				</div><!--/.row-->
			</div><!--/.container -->
		</section><!--/.signin -->
		
		<!-- signin end -->

		<!--footer copyright start -->
		<footer class="footer-copyright">
			<div id="scroll-Top">
				<i class="fa fa-angle-double-up return-to-top" id="scroll-top" data-toggle="tooltip" data-placement="top" title="" data-original-title="Back to Top" aria-hidden="true"></i>
			</div><!--/.scroll-Top-->

		</footer><!--/.hm-footer-copyright-->
		<!--footer copyright  end -->

		<%@include file="common/js.jsp"%>
    <script>
    $('#proName').on('blur',function(){
    $('#msg1').html('用户编码可作为登陆账号，请谨记！！！');
    
    });
    
    
    	//判断是否有这个商家
    	$('#proName').on("change", function() {
    		var pname = $('#proName').val();
    		var paddress = $("#proAddress").val();
    		isExist();
    	});
    
    	$('#proAddress').on("change", function() {
    		var pname = $('#proName').val();
    		var paddress = $("#proAddress").val();
    		isExist();
    	});
    
    
    	function isExist() {
    		var pname = $('#proName').val();
    		var paddress = $("#proAddress").val();
    
    		$.ajax({
    			url : "/Trip/provider/proExist",
    			data : {
    				pname : pname,
    				address : paddress
    			},
    			dataType : "json",
    			success : function(data) {
    				if (data == "noexist") { //如果已经存在，就返回提示信息
    					$('#proName').next().html("")
    				} else {
    					$('#proName').next().html("该商品已存在，请重新填入")
    					$('#proName').val("");
    					$("#proAddress").val("");
    				}
    			},
    			error : function(data) {
    				alert("验证失败");
    			}
    		});
    	}
    </script>

    

    </body>
    
    
</html>
